Professional Web Applications Themes

Gtk2: stange problem with notebook ? - Ruby

I have girc.rb and function.rb In girc.rg i have : "something" text = Gtk::TextView.new text.editable = false buffer = text.buffer buffer.create_tag("blue_bg", {"background" => "blue"}) iter = buffer.get_iter_at_offset(0) buffer.insert(iter, "Hello you, how are ") buffer.insert_with_tags(iter, "you ?", "blue_bg") listechan = Gtk::Notebook.new listechan.append_page(stext, Gtk::Label.new('_Info', true)) "something" it's work, a new tab is create in function.rb i have : def addserver(model, server) buffer = Hash.new if buffer == nil buffer[server] = Array.new if buffer[server] == nil buffer[server][0] = Gtk::TextView.new buffer[server][0].editable = false buffer[server][1] = buffer[server][0].buffer iter = buffer[server][1].get_iter_at_offset(0) buffer[server][1].insert(iter, "Hello 0") buffer[server][2] = Gtk::ScrolledWindow.new buffer[server][2].add(buffer[server][0]) p buffer[server] model.append_page(buffer[server][2], Gtk::Label.new('_Info2', true)) end and i ...

  1. #1

    Default Gtk2: stange problem with notebook ?

    I have girc.rb and function.rb
    In girc.rg i have :
    "something"
    text = Gtk::TextView.new
    text.editable = false

    buffer = text.buffer
    buffer.create_tag("blue_bg",
    {"background" => "blue"})
    iter = buffer.get_iter_at_offset(0)
    buffer.insert(iter, "Hello you, how are ")
    buffer.insert_with_tags(iter, "you ?", "blue_bg")
    listechan = Gtk::Notebook.new
    listechan.append_page(stext, Gtk::Label.new('_Info', true))
    "something"

    it's work, a new tab is create

    in function.rb i have :

    def addserver(model, server)
    buffer = Hash.new if buffer == nil
    buffer[server] = Array.new if buffer[server] == nil
    buffer[server][0] = Gtk::TextView.new
    buffer[server][0].editable = false

    buffer[server][1] = buffer[server][0].buffer
    iter = buffer[server][1].get_iter_at_offset(0)
    buffer[server][1].insert(iter, "Hello 0")
    buffer[server][2] = Gtk::ScrolledWindow.new
    buffer[server][2].add(buffer[server][0])
    p buffer[server]
    model.append_page(buffer[server][2], Gtk::Label.new('_Info2', true))
    end

    and i don't have a new tab when i call the function !!
    i call the function in girc.rb with :
    addserver(listechan, "irc..org")

    the line p buffer[server] display :
    [#<Gtk::TextView:0x402418c8 ptr=0x81fbf18>, #<Gtk::TextBuffer:0x402418a0
    ptr=0x81fbd60>, #<Gtk::ScrolledWindow:0x40241378 ptr=0x8213c28>]

    so why it don't work ??
    oxman Guest

  2. #2

    Default Re: Gtk2: stange problem with notebook ?

    thanks a lot !

    really !

    oxman Guest

Similar Threads

  1. PS7.0.1 very stange layer effects problem
    By iRudi@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 13
    Last Post: September 17th, 12:00 PM
  2. Stange error
    By ezd_macromedia in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: September 6th, 03:54 PM
  3. wxruby <=> ruby-gtk2
    By KONTRA Gergely in forum Ruby
    Replies: 1
    Last Post: October 20th, 03:37 PM
  4. PROBLEM: Notebook w/PCMCIA ethernet & docking station ethernet / Multiple NICs / Only use one at a time
    By ---==[Quasar]==--- in forum Linux Setup, Configuration & Administration
    Replies: 0
    Last Post: September 19th, 04:07 PM
  5. Weird gtk2/gnome problem
    By James Kahn in forum Debian
    Replies: 0
    Last Post: July 19th, 11:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139