Displaying 20 results from an estimated 21 matches for "append_item".
2004 Jan 28
1
Submenues
...add the ruby function
append_submenu(id, item, submenu, helpString) to the Wx::Menu class in 0.2,
which calls the wxWindows function
void wxMenu::Append( int id, const wxString& item, wxMenu *subMenu,
const wxString& helpString = "" ),
please?
Also, function append_item() doesn''t work:
menu = Menu.new
submenu = Menu.new
submenu.append(2, "item of submenu")
item_with_submenu = MenuItem.new(menu, 2, ''&Submenu'', '''', ITEM_NORMAL, submenu)
menu.append_item( item_with_submenu )
I get error: in `appen...
2004 May 03
1
Sub-menus?
Hey guys,
I have been trying unsuccessfully to create a menu that holds "sub-menus".
To clarify, I want something along the lines of when you click on a File
menu, then see the "New" menu, which you can click on to open a new layer of
menus. Is this supported yet in WxRuby?
Robert
_________________________________________________________________
Getting married? Find
2007 Jul 05
8
when can publish the next version?
when can publish the next version?
i am waiting...
_______________________________________________
wxruby-users mailing list
wxruby-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
2008 Jan 04
2
problem with Menu.append_check_item()
Menu.append_check_item(), like Menu.append(), is supposed to return a
reference to the created menu item. Here is a test code which seems to show
that this behavior works for append(), but fails for append_check_item().
This is the output I get:
% ruby test-menu.rb
#<Wx::MenuItem:0xb74c036c>
nil
Am I missing something or is this a bug? Both menu items are created and
work as expected. I
2007 Dec 30
1
ReOrdering Wx::TreeCtrl Items
...LINES_AT_ROOT)
tcr_project_root = @tc_project_list.add_root("Project List")
populate_project_tree(@project_list, tcr_project_root)
#...
#...
def populate_project_tree(h_project_list, parent_node)
h_project_list.each {|key, value|
tree_node = @tc_project_list.append_item(parent_node, key.to_s)
if value.class.to_s == "Hash"
populate_project_tree(value, tree_node)
end
}
end
#...
#==================================
The big picture is to be able to populate the tree control and then
re-order (NOT sorting) the item...
2008 May 11
2
instabilities in wxRuby 1.9.6
...ar = Wx::MenuBar.new
menuBar.append(viewMenu, "&View")
set_menu_bar menuBar
end
end
class TestFrame < Wx::Frame
def initialize
super(nil, -1, "Test Frame")
menu = Wx::Menu.new
menuItem = Wx::MenuItem.new(menu, -1, "Show child")
menu.append_item menuItem
evt_menu(menuItem) { ChildFrame.new(self).show }
menuBar = Wx::MenuBar.new
menuBar.append(menu, "&View")
set_menu_bar menuBar
end
end
class TestApp < Wx::App
def on_init
TestFrame.new.show
end
end
TestApp.new.main_loop
_______________________...
2008 May 20
0
[ wxruby-Bugs-20255 ] Instabilities on Linux - 1.9.7
...ar = Wx::MenuBar.new
menuBar.append(viewMenu, "&View")
set_menu_bar menuBar
end
end
class TestFrame < Wx::Frame
def initialize
super(nil, -1, "Test Frame")
menu = Wx::Menu.new
menuItem = Wx::MenuItem.new(menu, -1, "Show child")
menu.append_item menuItem
evt_menu(menuItem) { ChildFrame.new(self).show }
menuBar = Wx::MenuBar.new
menuBar.append(menu, "&View")
set_menu_bar menuBar
end
end
class TestApp < Wx::App
def on_init
TestFrame.new.show
end
end
TestApp.new.main_loop
require ''wx'...
2007 Dec 22
0
[ wxruby-Bugs-16519 ] crash with Submenus - need GC protection
...correct behavior
Group: current
Status: Open
Resolution: None
Priority: 5
Submitted By: Alex Fenton (brokentoy)
Assigned to: Alex Fenton (brokentoy)
Summary: crash with Submenus - need GC protection
Initial Comment:
With submenus within MenuBars, if the menu contents are created using MenuItem and append_item to the submenu, the app will crash if the submenu is opened after GC has run
Perhaps need a DISOWN typemap?
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=218&aid=16519&group_id=35
2007 Jun 20
0
[ wxruby-Bugs-11708 ] Wx::TreeCtrl#on_compare_items can not work
...end
def on_compare_items(item1, item2)
raise #no raise
end
end
class MyFrame < Wx::Frame
def initialize(title)
super(nil, -1, title)
@tree=MyTreeCtrl.new(self)
@root = @tree.add_root("The Root Item")
0.upto(15) do |x|
child= @tree.append_item(@root, "Item " + x.to_s())
@tree.sort_children(child)
end
@tree.sort_children(@root )
end
end
class MyApp < Wx::App
def on_init
$frame = MyFrame.new("Minimal wxRuby App")
$frame.show
return true
end
def on_fatal_exception
puts(&qu...
2004 Mar 16
0
MDI and submenues
...d")
}
#<< Test submenu
@submenu1 = Menu.new
@submenu1.append(1, "item 1")
@item_with_submenu1 = MenuItem.new(@fileMenu, 2, ''&Submenu 1'',
'''', ITEM_NORMAL, @submenu1)
@fileMenu.append_item( @item_with_submenu1 )
#>>
set_menu_bar( @menuBar )
end
end
class RbApp < App
def on_init
frame = MyFrame.new("MDI parent")
frame.show(TRUE)
end
end
a = RbApp.new
a.main_loop
#================================================
2006 Nov 04
0
[720] trunk/wxruby2/doc/textile/menu.txtl: Update, rubyify and tidy
...an class="lines">@@ -77,6 +82,8 @@
</span><span class="cx">
</span><span class="cx"> * "Menu.new":#Menu_new
</span><span class="cx"> * "Menu#append":#Menu_append
</span><ins>+* "Menu#append_item":#Menu_appenditem
+* "Menu#append_menu":#Menu_appendmenu
</ins><span class="cx"> * "Menu#append_check_item":#Menu_appendcheckitem
</span><span class="cx"> * "Menu#append_radio_item":#Menu_appendradioitem
</span><...
2007 Jun 05
0
[1051] trunk/wxruby2/samples/aui/aui.rb: Changed assign_image_list to set_image_list.
...<ins>+ tree.set_image_list(img_list)
</ins><span class="cx"> root = tree.add_root("Wx::AUI Project", 0)
</span><span class="cx"> items = []
</span><span class="cx"> 1.upto(5) { | i | items << tree.append_item(root, "Item #{i}", 0) }
</span></span></pre>
</div>
</div>
</body>
</html>
2004 Jul 16
2
TreeCtrl#get_item_data
Hi
I saw from the ChangeLog that [get|set]_client_data was removed from
ComboBox for 0.4.0 because the methods weren''t working properly.
TreeCtrl#get_item_data still seems to be there. I was wondering if
someone who understood the issue could say if TreeItemData might also be
afflicted with the same problems?
I seem to be segfaulting quite a bit (actually, on TreeEvt#get_item),
but it
2006 Dec 01
0
[766] trunk/wxruby2: Added item_data aliases for client_data functions, update doc & tests;
...- root = f.control.add_root(''foo'')
</del><ins>+ tree = f.control
+ root = tree.add_root(''foo'')
+ assert_nil(tree.get_item_data( tree.get_root_item))
</ins><span class="cx">
</span><del>- id = f.control.append_item(root, ''a hash'', -1, -1, { :a => 7 })
- assert_equal({:a => 7 },
- f.control.get_item_data(id) )
</del><ins>+ id = tree.append_item(root, ''a hash'', -1, -1, { :a => 7 })
+ assert_equal({:a => 7 }, tree.get_item_dat...
2007 Jan 06
0
[835] trunk/wxruby2/doc/textile: Updated documentation about TreeItemId
...ndividual items (including branches) in a tree control are
</span><del>-referenced by TreeItemIds. These ids are returned by methods such as
</del><ins>+referenced by *TreeItemIds*. These ids are returned by methods such as
</ins><span class="cx"> "append_item":#TreeCtrl_appenditem which add items to a tree, and by
</span><span class="cx"> TreeEvents which can be queried to find which item is being acted
</span><del>-upon. The ids can then be passed in as arguments to methods which modify
-items within the tree, suc...
2004 May 22
4
couple of questions
Hi folks
A couple of questions:
1) I seem to get funny artifacts in the display of TreeCtrl, ComboBox
and ListBox when the MDI child frame containing it is first painted (see
attached - it should be two-root treeview, unopened). I''m not sure if
it''s related to being in a MDI, but the controls sample looks OK. The
artifacts are cleared up when it''s repainted or
2006 Nov 16
0
[741] trunk/wxruby2: Fix get_item_data, hiding TreeItemData messiness, fix GC-ing (Alex Fenton)
...t.html, "TreeEvent":treeevent.html
</ins><span class="cx">
</span><ins>+h2. Working with TreeCtrl items
+
+In wxRuby, individual items (including branches) in a tree control are
+referenced by TreeItemIds. These ids are returned by methods such as
+"append_item":#TreeCtrl_appenditem which add items to a tree, and by
+TreeEvents which can be queried to find which item is being acted
+upon. The ids can then be passed in as arguments to methods which modify
+items within the tree, such as "set_item_text":#TreeCtrl_setitemtext.
+As well as the...
2007 Jun 05
0
[1050] trunk/wxruby2/doc/textile: Delete doc references to remove assign_image_list methods in Tree/ListCtrl
...pan class="lines">@@ -130,9 +130,6 @@
</span><span class="cx"> * "TreeCtrl.new":#TreeCtrl_new
</span><span class="cx"> * "TreeCtrl#add_root":#TreeCtrl_addroot
</span><span class="cx"> * "TreeCtrl#append_item":#TreeCtrl_appenditem
</span><del>-* "TreeCtrl#assign_buttons_image_list":#TreeCtrl_assignbuttonsimagelist
-* "TreeCtrl#assign_image_list":#TreeCtrl_assignimagelist
-* "TreeCtrl#assign_state_image_list":#TreeCtrl_assignstateimagelist
</del><sp...
2006 Nov 21
0
[744] trunk/wxruby2: get_data support & mem mgmt to all ControlWithItems types, using more
...39; })
+ assert_retrievable_data(f.control, 1, ''string item data'')
+ assert_retrievable_data(f.control, 2, 42.3)
+ end
+
+ def test_treectrl_itemdata
+ f = CtrlContainerFrame.new(Wx::TreeCtrl)
+ root = f.control.add_root(''foo'')
+
+ id = f.control.append_item(root, ''a hash'', -1, -1, { :a => 7 })
+ assert_equal({:a => 7 },
+ f.control.get_item_data(id) )
+
+ id = f.control.prepend_item(root, ''a float'', -1, -1, 7.8)
+ assert_equal(7.8,
+ f.control.get_item_data(id) )
+
+...
2004 Jan 08
3
pictorG
...nu(ID_EDITLAB) {
edit_label get_selection
}
evt_tree_key_down(self.get_id) {|e|
case e.get_key_code
when K_F2
edit_label get_selection
end
}
end
def build_from_tree parent,tree
m = parent.nil? ? Proc.new {|p,l| @root=add_root l} : Proc.new {|p,l| append_item p,l}
unless tree.kind_of? Tree
m.call parent,tree
else # tree is real tree
node = m.call parent,tree.label
tree.children.each {|i|
build_from_tree node,i
}
end
end
def ShowMenu id, pt
@tree_item = id
menu=Menu.new "Menu for #{id}"...